home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 117 / MacAddict 117.dmg / Software / Internet & Communication / Snak 5.1 (shareware).dmg / Snak.app / Contents / Resources / Scripts / NoTopics.txt < prev    next >
Text File  |  2005-03-14  |  2KB  |  44 lines

  1. # This is an example of how to use event hooks to change the Snak behavior.
  2. # If you want to prevent the channel topics from being displayed in the window
  3. # you can load this script. If they're not work-safe for example..
  4.  
  5.  
  6. # The raw_irc event hook is called for every message Snak receives from the server.
  7. # The ^ character means that Snak should not continue processing the message if
  8. # the event hook is activated.
  9.  
  10. # This variant is only going to be activated for topic changes in one particular channel #channelname
  11.  
  12. on ^raw_irc "% TOPIC #channelname*" {
  13. }
  14.  
  15.  
  16. # The % character is called a wildcard. It stands in for a single word.
  17. # The * character at the end is also a wildcard. It matches any sequence of characters.
  18.  
  19. # The message from the server is in this format:
  20.  
  21. #    :you!snak@67.71.61.233 TOPIC #channelname :new topic
  22.  
  23. # if you compare to the pattern you can see that this message will match.
  24. # On another channel it would be
  25.  
  26. #    :you!snak@67.71.61.233 TOPIC #otherchannel :other topic
  27. # This would not match the pattern because the channel name is different
  28.  
  29.  
  30.  
  31. # This variant does not have a specific channel name in the pattern so it will match any channel.
  32.  
  33. on ^raw_irc "% TOPIC *" {
  34. }
  35.  
  36.  
  37. # Just to complicate things, when you join a channel the server will send you the channel
  38. # topic in a so called numbered command. The command number is 332. 
  39. # So to intercept the topic both initially, and when someone change it after you've joined
  40. # we need to intercept both the TOPIC message and the numbered 332 command.
  41.  
  42. on ^332 * {
  43. }
  44.